#!/bin/sh
#
DEBUGSERVER="C:/Program Files/Texas Instruments/CC Essentials v3.1/DebugServer"

base="${0%/*}"

export PATH="$DEBUGSERVER/scripting/lib;$DEBUGSERVER/bin/win32;$DEBUGSERVER/win32/components;$DEBUGSERVER/win32/drivers;$PATH"

# Path to Rhino JAR File
RHINO_JAR="$DEBUGSERVER/scripting/lib/rhino/js.jar"

# Path to DebugServer JAR File
SCRIPTING_JARS="$DEBUGSERVER/scripting/lib/dss.jar"

# Name of Rhino Shell Java Application
RHINO_SHELL=org.mozilla.javascript.tools.shell.Main

# If the user chose to install the JRE with this DSS install - use that
# JRE.  Otherwise use whatever is on the PATH
JAVA=java.exe

# In stand-alone DSS - the installed jre is in INSTALLDIR/jre.  Check 
# here first
if [ -d "$DEBUGSERVER/../jre" ]; then
  JAVA="$DEBUGSERVER/../jre/bin/java.exe"
fi

# In CCE/CCS - the installed jre is in INSTALLDIR/eclipse/jre.  Check 
# here next
if [ -d "$DEBUGSERVER/../eclipse/jre" ]; then
  JAVA="$DEBUGSERVER/../eclipse/jre/bin/java.exe"
fi

# =========================================================================
# Launch Rhino script engine.  Import the scripting package.
#
c:/users/dr/iliad/bin/printargs
"$JAVA" -DXPCOM.RUNTIME="$DEBUGSERVER/win32" -cp "$RHINO_JAR;$SCRIPTING_JARS" $RHINO_SHELL $base/load.xs -c $base/SystemSetup.xml -a $@
